import request from "@/utils/request";
import qs from "qs";
export function userList(query) {
  return request({
    url: "/user/checkUserList",
    method: "get",
    params: query,
  });
}
//获取用户银行卡信息
export function bankAccount(query) {
  return request({
    url: "/account/userBankcardInfo",
    method: "get",
    params: query,
  });
}
//3.4	给用户退款
export function getRefund(data) {
  return request({
    url: "/house/reserveRefund",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: qs.stringify(data),
  });
}
//给商家转账
export function getTransfer(data) {
  return request({
    url: "/house/reservePayToAgency",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: qs.stringify(data),
  });
}
//转账给邀请人
export function reservePayToShare(data) {
  return request({
    url: "/house/reservePayToShare",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: qs.stringify(data),
  });
}
export function fetchList(query) {
  return request({
    url: "/user/subList",
    method: "get",
    params: query,
  });
}
//预定列表
export function fetchReserve(query) {
  return request({
    url: "/house/reserveList",
    method: "get",
    params: query,
  });
}
//预定订单列表
export function reserveOrder(query) {
  return request({
    url: "/house/reserveOrderList",
    method: "get",
    params: query,
  });
}
export function fetchAllList() {
  return request({
    url: "/user/list",
    method: "get",
    params: {},
  });
}
export function delObj(ids) {
  return request({
    url: "/user/delete",
    method: "delete",
    params: ids,
  });
}

export function saveObj(data) {
  return request({
    url: "/user/save",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: qs.stringify(data),
  });
}
export function updateObj(data) {
  return request({
    url: "/user/edit",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: qs.stringify(data),
  });
}
export function getObj(id) {
  return request({
    url: "/product/get",
    method: "get",
    params: id,
  });
}
//发放优惠券
export function sendCouponToUser(data) {
  return request({
    url: "/user/sendCouponToUser",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: qs.stringify(data),
  });
}
//用户优惠券列表
export function checkUserCouponList(userid) {
  return request({
    url: "/user/checkUserCouponList",
    method: "get",
    params: userid,
  });
}
//邀请奖励分佣订单列表
export function checkTraderOrderList(query) {
  return request({
    url: "/house/checkTraderOrderList",
    method: "get",
    params: query,
  });
};
//管理员查看某月的打卡奖励列表
export function checkBonusList(query) {
  return request({
    url: "/user/checkBonusList",
    method: "get",
    params: query,
  });
};
//给用户转账
export function bonusPayToUser(data) {
  return request({
    url: "/user/bonusPayToUser",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: qs.stringify(data),
  });
}
//查看商家列表

export function getShopList(data) {
  return request({
    url: "/shop/shopList",
    method: "get",
    params: data,
  });
}
//商家审核
export function getExamineShop(data) {
  return request({
    url: "/shop/examineShop",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: qs.stringify(data),
  });
}


